var AssetDetail = function () {
	var handleValidation = function() {
		 return {
	            init: function () {
	            	var assetAllocationId = $('#assetAllocationId').val();
	            	
	            	//审批记录点击事件
	            	$('#auditLi').unbind("click").click(function(){
	            		$('#detailContent').css('display','none');
	            		$('#auditRecord').css('display','block');
	            		$('#detailLi').removeClass('active');
	            		$('#auditLi').addClass('active');
	            	});
	            	//配置详情点击事件
	            	$('#detailLi').unbind("click").click(function(){
	            		$('#detailContent').css('display','block');
	            		$('#auditRecord').css('display','none');
	            		$('#auditLi').removeClass('active');
	            		$('#detailLi').addClass('active');
	            	});
	            	
			//表格初始化
	        var oTable = $('#modelEditable_comm').dataTable({
	            "autoWidth":false,
	            "paginate": false, //翻页功能
	            "lengthChange": false, //改变每页显示数据数量
	            "info": false,//页脚信息
	            "language": {
                    "zeroRecords": "数据为空"
                },
	            "columnDefs": [
       						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [0]
    						},
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [1]
    						}, 
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [2]
    						}, 
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [3]
    						}, 
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [4]
    						}, 
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [5]
    						}, 
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [6]
    						}, 
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [7]
    						},
    						{
    						    "data": null,
    						    'sortable': false,
    						    "defaultContent": "<center>--</center>",
    						    "targets": [8]
    						}
                        ],
	            "columns": [{ "data": "id" },
                            { "data": "projectName" },
                            { "data": "projectAmount" },
                            { "data": "amountInvested"},
                            { "data": "bankName" },
                            { "data": "bankDeposit" },
                            { "data": "bankAccount" },
                            { "data": "aadAmount" },
                            { "data": "remark" }
                            ],
	           "filter" : false,
	           "processing": false,
	           "serverSide": true,
	           "ajaxSource": ctx + "/assetAllocation/assetDetailList/"+assetAllocationId,
	           "serverMethod": "post",
	           "fnRowCallback" : function(nRow, aData, displayIndex) {
	        	   nRow.children[0].id = aData.id;
	        	   $('td:eq(0)', nRow).html(++displayIndex);
	        	   $(nRow).appendTo($('#modelEditable_tbody'));
            	   return nRow;
	           },
	           "fnServerData" : function(ajaxSource, dataSet, fnCallback) {
                   $.ajax({
                   	"contentType":"application/json; charset=UTF-8",
                       "dataType" : 'json',
                       "type" : "POST",
                       "url" : ajaxSource,
                       "data" : "",
                       "success" : fnCallback
                   });
	           },
	        });
  
            
	            }

	        };    
	}();
	
    return {
        init: function () {
            handleValidation.init();
        }
    };
}();
